package com.itheima.health.dao;

import com.itheima.health.pojo.Member;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface MemberMapper {
    /**
     * 通过身份证查找用户
     * @param idCard
     * @return
     */
    @Select("select * from t_member where idCard = #{idCard}")
    Member selectByIdCard(String idCard);

    /**
     * 插入会员
     * @param member1
     */
    void insert(Member member1);

    /**
     * 通过id查找
     * @param memberId
     * @return
     */
    @Select("select * from t_member where id = #{memberId}")
    Member findById(Integer memberId);

    /**
     * 根据日期查询用户数量
     * @param map
     * @return
     */
    Integer selectByMap(Map map);

    /**
     * 查询所有用户数量
     * @return
     */
    @Select("select count(*) from t_member")
    Integer selectAll();
}
